from celery import Celery
from flask import Flask

from main.apis import init_api
from main.ext import init_ext


def create_app(env):
    app = Flask(__name__, template_folder='../templates')
    # print(app.template_folder)
    app.config.from_object(env)
    init_ext(app)
    init_api(app)
    # Celery异步
    # celery.conf.update(app.config)

    return app

